public class hw7 {
    public static void main(String[] args) {
        int[][] student=new int[20][5];
        int[] sum=new int[20];
        int total,avg;
        total=avg=0;
        int total1=0;
        int num=0;
        for (int i=0;i<20;i++){
            total=avg=0;
            System.out.println("\n第"+(i+1)+"名学生的成绩");
            System.out.println("\t"+"core"+"\t"+"C++"+"\t"+"coreJava"+"\t"+"Servlet"+"\t"+"EJB");
            for (int j=0;j<5;j++){
                student[i][j]=num=(int)(Math.random()*100);
                total+=student[i][j];
                if (j==2){
                    total1+=student[i][j];
                }
                System.out.print("\t"+student[i][j]+"\t");
            }
            sum[i]=total;
        }
        avg=total1/20;
        System.out.println("\n20名学生的c++成绩平均分为："+avg);
    }
}
